<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model backend\modules\home\models\Advertlist */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="advertlist-form">

    <?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'desc')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'url')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'img_path')->textInput(['maxlength' => true]) ?>

    <?php if($model->isNewRecord){ ?>

    <?= $form->field($model, 'start')->textInput(['type' => 'date', 'value' => date('Y-m-d')]) ?>

    <?= $form->field($model, 'finish')->textInput(['type' => 'date']) ?>

    <?php }else{ ?>

    <?= $form->field($model, 'start')->textInput(['type' => 'date']) ?>

    <?= $form->field($model, 'finish')->textInput(['type' => 'date']) ?>

    <?php }?>

    <?= $form->field($model, 'click_num')->textInput() ?>

    <?= $form->field($model, 'status')->dropDownList(['1' => '上架', '0' => '下架']) ?>

    <div class="form-group">
        <?= Html::submitButton('Save', ['class' => 'btn btn-success']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>
